package com.neusoft.hifly.commons.id;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(IdWorkerProperties.class)
public class IdWorkerConfig {

	@Bean
	public IdWorker idWorker(final IdWorkerProperties prop) {
		return new IdWorker(prop.getWorkerId(), prop.getDatacenterId());
	}
}
